-- Ejercicio 2 Practico 2 
-- deco de 3 entradas a 8 salidas usando CASE

library IEEE;
use ieee.std_logic_1164.all;

entity ej2_loop is
port (A: in integer range 0 to 7;
      Y: out std_logic_vector (7 downto 0)
	  );
end ej2_loop;

architecture ej2 of ej2_loop is
begin
deco: process (A)
begin
	Y <= "00000000";
	for I in 0 to 7 loop
		if (A = I) then
			Y(I) <= '1';
		end if;
	end loop;
end process;
end ej2;